From 487d27be080b56595dd823a0f4b108b0be79b269 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Wed, 16 Feb 2005 15:48:27 +0000 Subject: [PATCH] bitkeeper revision 1.1212 (42136b4bPyYaGldMQjQcAZc9eqgGww) Clean up serial-line code. Pull out arch-dep to asm header file. Signed-off-by: Arun Sharma Signed-off-by: Keir Fraser --- .rootkeys | 1 + xen/arch/ia64/xenmisc.c | 21 --------------------- xen/arch/ia64/xensetup.c | 17 +++-------------- xen/drivers/char/serial.c | 23 ++++++++--------------- xen/include/asm-ia64/config.h | 7 +------ xen/include/asm-ia64/xenserial.h | 17 ----------------- xen/include/asm-x86/serial.h | 22 ++++++++++++++++++++++ xen/include/xen/serial.h | 6 +++++- 8 files changed, 40 insertions(+), 74 deletions(-) create mode 100644 xen/include/asm-x86/serial.h diff --git a/.rootkeys b/.rootkeys index fe46452b33..37ed52e46b 100644 --- a/.rootkeys +++ b/.rootkeys @@ -1131,6 +1131,7 @@ 3ddb79c2QF5-pZGzuX4QukPCDAl59A xen/include/asm-x86/processor.h 40cf1596bim9F9DNdV75klgRSZ6Y2A xen/include/asm-x86/regs.h 3ddb79c2plf7ciNgoNjU-RsbUzawsw xen/include/asm-x86/rwlock.h +42136b49h6MkeayfuOaTPcJQWKga2g xen/include/asm-x86/serial.h 405b8599BsDsDwKEJLS0XipaiQW3TA xen/include/asm-x86/shadow.h 3ddb79c3Hgbb2g8CyWLMCK-6_ZVQSQ xen/include/asm-x86/smp.h 3ddb79c3jn8ALV_S9W5aeTYUQRKBpg xen/include/asm-x86/smpboot.h diff --git a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c index c3d7d6716a..663319de3c 100644 --- a/xen/arch/ia64/xenmisc.c +++ b/xen/arch/ia64/xenmisc.c @@ -203,27 +203,6 @@ void dump_pageframe_info(struct domain *d) printk("dump_pageframe_info not implemented\n"); } -/////////////////////////////// -// from drivers/char/serial.c -/////////////////////////////// - -#include - -int -ia64_serial_putc(unsigned char c) -{ - if (platform_is_hp_ski()) { - ia64_ssc(c, 0, 0, 0, SSC_PUTCHAR); - } - else { -// this is tested on HP Longs Peak platform... it -// will probably work on other Itanium platforms as -// well, but undoubtedly needs work - longs_peak_putc(c); - } - return 1; -} - /////////////////////////////// // from common/physdev.c /////////////////////////////// diff --git a/xen/arch/ia64/xensetup.c b/xen/arch/ia64/xensetup.c index e778b897d9..5515b3bf34 100644 --- a/xen/arch/ia64/xensetup.c +++ b/xen/arch/ia64/xensetup.c @@ -142,23 +142,12 @@ void cmain(multiboot_info_t *mbi) /* Must do this early -- e.g., spinlocks rely on get_current(). */ set_current(&idle0_exec_domain); + early_setup_arch(); + /* We initialise the serial devices very early so we can get debugging. */ serial_init_stage1(); - init_console(); -#if 0 - /* HELLO WORLD --- start-of-day banner text. */ - printk(XEN_BANNER); - printk(" http://www.cl.cam.ac.uk/netos/xen\n"); - printk(" University of Cambridge Computer Laboratory\n\n"); - printk(" Xen version %d.%d%s (%s@%s) (%s) %s\n", - XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION, - XEN_COMPILE_BY, XEN_COMPILE_DOMAIN, - XEN_COMPILER, XEN_COMPILE_DATE); -#endif -#ifndef IA64 - printk(" Latest ChangeSet: %s\n\n", XEN_CHANGESET); -#endif + init_console(); set_printk_prefix("(XEN) "); #ifdef IA64 diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c index 29cfb61fd8..cc6e45a970 100644 --- a/xen/drivers/char/serial.c +++ b/xen/drivers/char/serial.c @@ -6,7 +6,7 @@ * it permits debugging of seriously-toasted machines (e.g., in situations * where a device driver within a guest OS would be inaccessible). * - * Copyright (c) 2003-2004, K A Fraser + * Copyright (c) 2003-2005, K A Fraser */ #include @@ -18,11 +18,6 @@ #include #include -/* opt_com[12]: Config serial port with a string ,DPS,,. */ -static unsigned char opt_com1[30] = "", opt_com2[30] = ""; -string_param("com1", opt_com1); -string_param("com2", opt_com2); - /* Register offsets */ #define RBR 0x00 /* receive buffer */ #define THR 0x00 /* transmit holding */ @@ -100,15 +95,13 @@ static uart_t com[2] = { #define UART_ENABLED(_u) ((_u)->baud != 0) #define DISABLE_UART(_u) ((_u)->baud = 0) -#ifdef CONFIG_X86 -static inline int arch_serial_putc(uart_t *uart, unsigned char c) -{ - int space; - if ( (space = (inb(uart->io_base + LSR) & LSR_THRE)) ) - outb(c, uart->io_base + THR); - return space; -} -#endif +/* Architecture-specific private definitions. */ +#include + +/* opt_com[12]: Config serial port with a string ,DPS,,. */ +static unsigned char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR; +string_param("com1", opt_com1); +string_param("com2", opt_com2); /*********************** diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index ac0721d89f..80a80c0eb0 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -2,6 +2,7 @@ // manufactured from component pieces // defined in linux/arch/ia64/defconfig +//#define CONFIG_IA64_GENERIC #define CONFIG_IA64_HP_SIM #define CONFIG_IA64_L1_CACHE_SHIFT 7 // needed by include/asm-ia64/page.h @@ -184,8 +185,6 @@ struct pci_bus_region { (likely(sizeof(count) <= 4) /* disallow 64-bit counts */ && \ access_ok(type,addr,count*size)) -// see drivers/char/serial.c -#define arch_serial_putc(uart,c) ia64_serial_putc(c) // without this, uart_config_stageX does outb's which are non-portable #define NO_UART_CONFIG_OK @@ -203,10 +202,6 @@ struct pci_bus_region { // x86 typedef still used in sched.h, may go away later //typedef unsigned long l1_pgentry_t; -// removed from include/xen/types.h (why?) -typedef unsigned long uint64_t; -typedef unsigned int uint32_t; - // see include/asm-ia64/mm.h, handle remaining pfn_info uses until gone #define pfn_info page diff --git a/xen/include/asm-ia64/xenserial.h b/xen/include/asm-ia64/xenserial.h index 0b4ea621e2..e69de29bb2 100644 --- a/xen/include/asm-ia64/xenserial.h +++ b/xen/include/asm-ia64/xenserial.h @@ -1,17 +0,0 @@ -// this file is now obsolete and can be removed -#include - -static inline int arch_serial_putc(unsigned char c) -{ - if (platform_is_hp_ski()) { - ia64_ssc(c, 0, 0, 0, SSC_PUTCHAR); - } - else { -// this is tested on HP Longs Peak platform... it -// will probably work on other Itanium platforms as -// well, but undoubtedly needs work - longs_peak_putc(c); - } - return 1; -} - diff --git a/xen/include/asm-x86/serial.h b/xen/include/asm-x86/serial.h new file mode 100644 index 0000000000..3ec4a2e1e9 --- /dev/null +++ b/xen/include/asm-x86/serial.h @@ -0,0 +1,22 @@ +/* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */ +/****************************************************************************** + * asm-x86/serial.h + * + * Architecture-specific private serial definitions. + */ + +#ifndef __ASM_X86_SERIAL_H__ +#define __ASM_X86_SERIAL_H__ + +#define OPT_COM1_STR "" +#define OPT_COM2_STR "" + +static inline int arch_serial_putc(uart_t *uart, unsigned char c) +{ + int space; + if ( (space = (inb(uart->io_base + LSR) & LSR_THRE)) ) + outb(c, uart->io_base + THR); + return space; +} + +#endif /* __ASM_X86_SERIAL_H__ */ diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h index 5c40db3e7d..b5f5affdb2 100644 --- a/xen/include/xen/serial.h +++ b/xen/include/xen/serial.h @@ -1,3 +1,4 @@ +/* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */ /****************************************************************************** * serial.h * @@ -5,7 +6,10 @@ * it permits debugging of seriously-toasted machines (e.g., in situations * where a device driver within a guest OS would be inaccessible). * - * Copyright (c) 2003-2004, K A Fraser + * This file contains public definitions. The arch-specific header + * contains only private hooks, and is not included from this file. + * + * Copyright (c) 2003-2005, K A Fraser */ #ifndef __XEN_SERIAL_H__ -- 2.30.2